package com.wushi.smartorm;

import com.sun.org.apache.xpath.internal.operations.Or;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: smartorm
 * @description:
 * @author: Grant Wu
 * @create: 2020-05-18 22:59
 **/
public class MapperConfig {
//    @Value("smartorm.basepackage")
//    private String basepackage;


    public static final String SELECT_SQL="select";
    public static final String UPDATE_SQL="update";
    public static final String INSERT_SQL="insert";
    public static final String DELETE_SQL="delete";

    public static final String TINYINT="TINYINT";
    public static final String SMALLINT="SMALLINT";
    public static final String INT="INT";
    public static final String BIGINT="BIGINT";
    public static final String VARCHAR="VARCHAR";
    public static final String DOUBLE="DOUBLE";
    public static final String FLOAT="FLOAT";
    public static final String DATETIME="DATETIME";


    public static Map<String, String> getSql(String className, String methodName) {
        Map<String ,String > sqlMap=new HashMap<>();
        String selectSql=OrmPropertiesReader.getProperty("smartorm.selectByPrimaryKey");
        sqlMap.put(MapperConfig.SELECT_SQL, selectSql);
        return sqlMap;
    }

    public static String getModel() {
        return OrmPropertiesReader.getProperty("smartorm.namespace");
    }

}
